package com.ftd.controller;

import com.ftd.DBConnection.DBConnection;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by apple on 16/8/3.
 */
@Controller
@RequestMapping("/hibook")
public class RegisterController {
    @RequestMapping("register")
    public String register(){
        return "register";
    }
    @RequestMapping("saveInBackground")
    @ResponseBody
    public boolean saveInBackground(String phonenumber){
        System.out.println(phonenumber);
        DBConnection.insert(phonenumber);
        return true;
    }
//    @RequestMapping("saveInBackground/{phonenumber}")
//    @ResponseBody
//    public boolean saveInBackground(@PathVariable String phonenumber){
//        System.out.println(phonenumber);
//        DBConnection.insert(phonenumber);
//        return true;
//    }


}
